<!-- /* Description for file.
 * 简历等级
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/resumeranks
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0618
 * @lastmodified  张海杰2011年0630
 */
 -->
<?php
echo $html->css ( 'style' );
echo $html->css ( 'tab' );
echo $javascript->link ( 'jquery' );
?>
<script>	
$(document).ready(function(){
	$("#ResumerankToplist").change(function()
	{									
		var Toplist = $(this).find('option:selected').text();
		
		if($(this).val() < 0){
			$ ("#ResumerankField1").attr("value",'');
		}
		else{
			$("#ResumerankField1").val(Toplist);
		}
	});
	$("#btnajaxDel").click(function(){
	    var op = $("select option:selected").text();
	    if(op == ""){
			alert("请选择你要删除的项");
			return;
	    }
		if(!confirm("确定删除?"))
		{
			return;
		} 			
		$.post(
				'<?php echo ROOT_WEB_PATH; ?>/resumeranks/delete/'+$("select option:selected").val(),
			{
				id: $("select option:selected").val()
				
				},
			function(data){
				window.location.reload();
			});
		});
	
	$("#btnajaxAdd").click(function(){
		$.post(
			'<?php echo ROOT_WEB_PATH; ?>/resumeranks/resumeranksAdd/',
			{
				data: {Resumerank :{name: $('#ResumerankField1').val()}}
				},
				function(data){
				window.location.reload();
				}
			);
		});
	$("#btnajaxSave").click(function(){
		$.post(
			'<?php echo ROOT_WEB_PATH; ?>/resumeranks/edit/'+ $("select option:selected").val(),
			{
				data: {Resumerank :{name: $('#ResumerankField1').val(),
									id: $("select option:selected").val()

				}}
				},
			function(data){		
					//alert($("select option:selected").val());
					window.location.reload();
				}
				
				);
		});

});



</script>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Systemconfigs');//一级目录
										   echo '>';echo __('Resumesetting');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Resumeranks',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->

<?php echo $form->create('Resumerank',array('action'=>'init','type'=> 'post'));?>

<div class="tabflex">
<!-- 简历等级  -->
<fieldset><legend><?php __('Resumeranks');?></legend>
<table width="98%" cellspacing="0" cellpadding="0" border="0" style="text-align:left">
	<tr>
	<td width="50%"><?php __('Resumeranks init');?></td>
	<td width="50%"><?php __('Resumeranks add');?></td>
	</tr>
	<tr>
	<!-- 定制 -->
	<td>
		<table width="98%" cellspacing="0" cellpadding="0" border="0" >
			<tr>
				<td width="40%">
				<!-- 下拉列表 -->
				<?php
					$options = array();
					foreach($toplist as $eachrecord)
					{
						$options[$eachrecord['Resumerank']['id']] = $eachrecord['Resumerank']['name'];
					}
					echo $form->input('toplist',array('options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1','size'=>4));		
				?>
				</td>
				<td valign="top" width="30px">
							<a><?php echo $html->image('delete.gif', array('alt' =>  __('Delete', true),'border'=>'0','id'=>'btnajaxDel'));?></a> 
							<!-- 删除 -->
				</td>
				<td></td>
			</tr>
		</table>
	</td>
	<!-- 添加&修改  -->
	<td>
		<table width="78%" cellspacing="0" cellpadding="0" border="0" >
			<tr>
			<td valign="top" width="70%">
				<?php echo $form->text('Field1',array('class' => 'TextBoxE1')); ?>
			</td>
			<td>
				<a><?php echo $html->image('add.gif', array('alt' =>  __('Add', true),'border'=>'0','id'=>'btnajaxAdd'));?> </a>
					 		<!-- 添加 -->
			</td>
			<td>
				<a><?php echo $html->image('edit.gif', array('alt' =>  __('Edit', true),'border'=>'0','id'=>'btnajaxSave')); ?></a> 
							<!-- 修改 --></td>
			<td></td>
							
			</tr>
		</table>
	</td>
	
	</tr>
</table>

</fieldset>
</div>
<!-- 简历等级 -->

<?php echo $form->end();?>
